﻿using System;
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Numerics.LinearAlgebra.Generic;

namespace innovations.util
{
    public class MoreMath
    {
        public static Vector<double> Log(Vector<double> vector)
        {
            Vector<double> tempVector = new DenseVector(vector);
            for (int i = 0; i < vector.Count; i++)
                tempVector[i] = Math.Log(tempVector[i]);
            return tempVector;
        }

        public static Matrix<double> Log(Matrix<double> matrix)
        {
            Matrix<double> tempMatrix = new DenseMatrix(matrix);
            for (int i = 0; i < matrix.RowCount; i++)
            {
                for (int j = 0; j < matrix.ColumnCount; j++)
                    tempMatrix[i,j] = Math.Log(tempMatrix[i,j]);
            }
            return tempMatrix;
        }
    }
}
